#include<bits/stdc++.h>
#define int long long
using namespace std;

signed main() {
	int n, m;
	cin >> n >> m;
	int t = 0;
	for(int i = 1; i <= m; ++ i ) {
		int x;
		cin >> x;
		t += x;
	}
	if(t <= n) {
		cout << 0 << endl;
		return 0;
	}
	cout << (t / n) << endl;
	cout << t % n * (n - t / n) << endl;
	return 0;
}

